
function set_number(self){var addgoods=document.getElementById('ks_addgoods');if(/^[-]?\d+$/.test(self.value)){if(addgoods.href.lastIndexOf("number") < 0){addgoods.href += '&number='+self.value;}else{addgoods.href=addgoods.href.substring(0,addgoods.href.lastIndexOf("&number"))
addgoods.href += '&number='+self.value;}
}else{alert('购买数量只能是整数');self.value=1;}
}
function li_tab(li_hover,li_link){document.getElementById(li_hover).className='li_hover';document.getElementById(li_link).className='li_link';if(li_hover=='li_tab_1'){document.getElementById('ifo').style.display='';document.getElementById('desc').style.display='none';}else{document.getElementById('ifo').style.display='none';document.getElementById('desc').style.display='';}
}
function ks_close(){document.getElementById('background_div').style.display='none';document.getElementById('case_div').style.display='none';}
_ks_open_k=false;_response=false;responseText='';function ks_open(goods_id,baseURL,Page,text){_ks_open_k=false;_response=false;document.getElementById('background_div').style.display='';document.getElementById('case_div').style.display='';var url=baseURL+'ks.php?goods_id='+goods_id;if(typeof(Page)!="undefined"){url += '&Page='+Page;}
if(typeof(text)!="undefined"){url += '&text='+encodeURIComponent(text);}
addNumber("GET",url,true,text_onblur);}
function text_onblur(xmlHttp,parameter,Unsuccessful){if(Unsuccessful=='Unsuccessful'){document.getElementById('main_body').style.display='none';document.getElementById('indicator_div').style.display='';setTimeout("ks_open_k()",1000);}else{_response=true;responseText=xmlHttp.responseText;ks_open_display();}
}
function ks_kd_open(url){


	_ks_open_k=false;
	_response=false;
	document.getElementById('background_div').style.display='';
	document.getElementById('case_div').style.display='';
	addNumber("GET",url,true,kd_text_onblur);
	}
function kd_text_onblur(xmlHttp,parameter,Unsuccessful)
	{if(Unsuccessful=='Unsuccessful')
	{document.getElementById('main_body').style.display='none';document.getElementById('indicator_div').style.display='';
	setTimeout("ks_open_k()",1000);}else{_response=true;responseText=xmlHttp.responseText;
	ks_open_display();}
}
function ks_open_k(){if(_ks_open_k==false){_ks_open_k=true;ks_open_display();}
}
function ks_open_display(){
	if(_ks_open_k && _response)
		{if(responseText=='')
		{ks_close();return '';}
document.getElementById('main_body').style.display='';document.getElementById('indicator_div').style.display='none';
document.getElementById('main_body').innerHTML=responseText;}
}
ks_k=true;function ks_over(self,baseURL,goods_id){fast_img_width=76;fast_img_Height=20;obj_location=getxy(self);l=obj_location.left;t=obj_location.top;var all_div=self.getElementsByTagName('div');if(all_div.length==0){var div=document.createElement("div");div.id='fast';cssText='';cssText += 'margin:0 auto;';cssText += 'position:absolute;';cssText += 'left:'+(l+self.scrollWidth/2-fast_img_width/2)+'px;';cssText += 'top:'+(t+self.scrollHeight-fast_img_Height-20)+'px;';div.style.cssText=cssText;div.innerHTML='<a class="fast_a" href="javascript:ks_open(\''+goods_id+'\',\''+baseURL+'\');">'+
'<img class="fast_img" id="fast_img" alt="快速查看" src="'+baseURL+'imgs/goods_list_fast.gif" />'+
'</a>';self.appendChild(div);}
}
function ks_out(ev,self){ks_k=false;obj_location=getxy(self);l=obj_location.left;t=obj_location.top;ev=ev||window.event;mousePos=new XmouseCoords(ev,0,document.getElementById('main').scrollTop);x=mousePos.x; y=mousePos.y;if(x-5 < l){ks_k=true;}
if(x > l+self.scrollWidth){ks_k=true;}
if(y-5 < t){ks_k=true;}
if(y > t+self.scrollHeight){ks_k=true;}
if(ks_k){var all_div=self.getElementsByTagName('div');self.removeChild(all_div[0]);}
}
function ObjLocation(obj){if(window.ActiveXObject) { t=0;l=0;while(obj.tagName != 'BODY')
{t += obj.offsetTop;l += obj.offsetLeft;obj=obj.parentNode;} } else if(window.XMLHttpRequest) { t=obj.offsetTop;l=obj.offsetLeft
while(obj==obj.offsetParent)
{t += obj.offsetTTop
l += obj.offsetLeft
} }
return {left:l,top:t}
}
function getxy(e){var a=new Array()
var t=e.offsetTop;var l=e.offsetLeft;var w=e.offsetWidth;var h=e.offsetHeight;while(e=e.offsetParent){t+=e.offsetTop;l+=e.offsetLeft;}
a[0]=t;a[1]=l;a[2]=w;a[3]=h
return {left:l,top:t};}